<?php
include_once("../metier/question.dao.php");
include_once("../metier/question.class.php");

header("Content-Type: text/plain");

$libelle = (isset($_GET["libelle"])) ? $_GET["libelle"] : NULL;
$indice = (isset($_GET["indice"])) ? $_GET["indice"] : NULL;
$categorie = (isset($_GET["cat"])) ? $_GET["cat"] : NULL;

if ($libelle) {
	$db = new myPDO("127.0.0.1", "root", "", 0);
	$questionDAO = new QuestionDAO();
	$question = new Question(0, $libelle, null, $indice, $categorie);
	$questionDAO->createQuestion($question, $db);
} else {
    echo "FAIL";
}

?>